package org.msb.accentis.data.pojo;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

/**
 * 
 * 
 * @author Marc Boudreau
 *
 * @since 1.0
 */
@Entity
@NamedQueries(@NamedQuery(name = "BankAccountIdMapping.findMapping", query = "SELECT m FROM BankAccountIdMapping m WHERE m.bankAccountId = :bankAccountId"))
public class BankAccountIdMapping {

	@Id
	private String bankAccountId;

	@ManyToOne
	private Account account;

	public String getBankAccountId() {
		return bankAccountId;
	}

	public void setBankAccountId(String value) {
		bankAccountId = value;
	}

	public Account getAccount() {
		return account;
	}

	public void setAccount(Account value) {
		account = value;
	}

	@Override
	public boolean equals(Object obj) {
		if (super.equals(obj))
			return true;

		if (obj instanceof BankAccountIdMapping)
			return null == bankAccountId ? null == ((BankAccountIdMapping) obj).bankAccountId : bankAccountId
					.equals(((BankAccountIdMapping) obj).bankAccountId);

		return false;
	}

	@Override
	public int hashCode() {
		return null == bankAccountId ? 0 : bankAccountId.hashCode();
	}
}
